#ifndef _CODEBLOCKS_SRC_FIND_REPLACE_H_
#define _CODEBLOCKS_SRC_FIND_REPLACE_H_

struct cbFindReplaceData;
class M_Code_StyledTextCtrl;
class wxString;
class cbSearchResultsLog;

class FindReplace {
  public:
    FindReplace();
    ~FindReplace();
    int ShowFindDialog( bool replace,  bool explicitly_find_in_files = false );
    int FindNext( bool goingDown, M_Code_StyledTextCtrl* control, cbFindReplaceData* data, bool selected );
    int FindSelectedText( bool goingDown );
  private:
    void CalculateFindReplaceStartEnd( M_Code_StyledTextCtrl* control, cbFindReplaceData* data, bool replace = false );
    int Find( M_Code_StyledTextCtrl* control, cbFindReplaceData* data );
    int Replace( M_Code_StyledTextCtrl* control, cbFindReplaceData* data );
    int ReplaceInFiles( cbFindReplaceData* data );
  private:
    cbFindReplaceData *m_LastFindReplaceData;
};

#endif
